<template>
  <view>
    <view class="box">
      <view class="box-img">
        <image
          :src="`../../static/images/${detailList.lottery_id}.png`"
          mode=""
        ></image>
        <span>
          {{ detailList.lottery_name }} <br />
          {{ detailList.lottery_no }}
        </span>
        <span @click="go()">历史开奖</span>
      </view>
      <view class="radio">
        <span>{{ detailList.lottery_res }}</span>
      </view>
      <view class="xiaoliang">
        <span
          >本期销量(元) <br />
          {{ detailList.lottery_sale_amount }}</span
        >
        <span
          >奖池信息(元) <br />
          {{ detailList.lottery_pool_amount }}</span
        >
      </view>
    </view>
    <view class="box3">
      <span>奖项</span>
      <span>中奖条件</span>
      <span>中奖注数</span>
      <span>每注奖金(元)</span>
    </view>
    <view class="box1" v-for="item in detailList1" :key="item.id">
      <view class="box1-title">
        <span>
          {{ item.prize_name }}
        </span>
        <span>
          {{ item.prize_require }}
        </span>
        <span>
          {{ item.prize_num }}
        </span>
        <span>
          {{ item.prize_amount }}
        </span>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      detailList: {},
      detailList1: [],
      detail_id: "",
      // tait: this,
    };
  },
 onLoad:function (option)  {
	uni.request({
        url: "http://api.aslegou.top/api/cpdesc",
        method: "GET",
        data: {
          lottery_id: option.id,
        },
        success: (res) => {
          // console.log(res.data.list);
          this.detailList = res.data.list;
          this.detailList1 = res.data.list.lottery_prize;
          //   console.log(this.detailList1);
          //   console.log(this.detailList1);
        },
      });
 },
  methods: {
    
    go() {
      uni.navigateTo({
        url: "/pages/history/history",
      });
    },
  },
};
</script>

<style lang="less" scoped>
.box {
  width: 100vw;
  height: 100v;
  .box-img {
    width: 100%;
    height: 100px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    image {
      width: 50px;
      height: 50px;
    }
  }
  .xiaoliang {
    width: 100%;
    height: 100px;
    display: flex;
    justify-content: space-around;
    align-items: center;
  }
}
.box1-title {
  width: 100%;
  display: flex;
  justify-content: space-around;
  align-items: center;
}
.box3 {
  width: 100%;
  display: flex;
  justify-content: space-around;
  align-items: center;
}
</style>
